package com.bcbim.authentication.role.service;

import com.bcbim.authentication.role.mapper.RoleMapper;
import com.bcbim.authentication_interface.role.dao.RoleDAO;
import com.bcbim.authentication_interface.role.dto.RoleDTO;
import com.bcbim.authentication_interface.role.service.RoleService;
import com.bcbim.authentication_interface.role.vo.RoleListVO;
import com.bcbim.authentication_interface.role.vo.RoleVO;
import com.bcbim.common.sys.Code;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Description:角色控制实现接口
 * @Author XueHao
 * @Date 2021/8/16
 * @Version V1.0
 **/
@Service(timeout = 60 * 1000, group = "role", version = "1.0.0")
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;
    /**
     * @Description 查询角色列表条数
     * @Author XueHao
     * @Date 2021/8/16
     * @return int
     */
    @Override
    public int getRoleListCount(RoleDTO roleDTO) {
        return roleMapper.getRoleListCount(roleDTO);
    }

    /**
     * @Description 查询角色列表条数
     * @Author XueHao
     * @Date 2021/8/16
     * @return List<RoleListVO>
     */
    @Override
    public List<RoleListVO> listRole(RoleDTO roleDTO) {
        return roleMapper.listRole(roleDTO);
    }

    /**
     * @Description 删除角色
     * @Author XueHao
     * @Date 2021/8/16
     * @return int
     */
    @Override
    public int removeRole(String id) {
        return roleMapper.removeRole(id);
    }

    /**
     * @Description 新增角色
     * @Author XueHao
     * @Date 2021/8/16
     * @return int
     */
    @Override
    public int insertRole(RoleDAO roleDAO) {
        return roleMapper.insertRole(roleDAO);
    }

    /**
     * @Description 修改角色
     * @Author XueHao
     * @Date 2021/8/17
     * @return int
     */
    @Override
    public int updateRole(RoleDAO roleDAO) {
        return roleMapper.updateRole(roleDAO);
    }

    /**
     * @Description 状态下拉列表
     * @Author XueHao
     * @Date 2021/8/20
     * @return List<Code>
     */
    @Override
    public List<Code> selectEnable() {
        return roleMapper.selectEnable();
    }

    /**
     * @Description 查询角色列表
     * @Author XueHao
     * @Date 2021/8/23
     * @return RoleVO
     */
    @Override
    public RoleVO getRoleVO(String id) {
        return roleMapper.getRoleVO(id);
    }

}
